<html>
<head><meta charset="utf-8"><title>The Book of Error · project-error-handling · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/index.html">project-error-handling</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html">The Book of Error</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210758206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210758206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210758206">(Sep 21 2020 at 15:31)</a>:</h4>
<p>Early impression of the teams and working groups is that GH issues and PRs get a<br>
lot of traction and shares which OFC is always appreciated but it's still<br>
sometimes a pretty big data dump loaded with background info and links. Maybe we<br>
would start by defining and including some of our key terms in the <code>rustc</code> docs<br>
glossary and drafting a shared bibliography and tl;dr notes?</p>



<a name="210758545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210758545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210758545">(Sep 21 2020 at 15:34)</a>:</h4>
<p>That is pretty much reflected here: <br>
<a href="https://github.com/rust-lang/project-error-handling/blob/master/CHARTER.md">https://github.com/rust-lang/project-error-handling/blob/master/CHARTER.md</a></p>



<a name="210759148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210759148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210759148">(Sep 21 2020 at 15:38)</a>:</h4>
<p>Something like this: <a href="https://github.com/rust-lang/wg-async-foundations/tree/master/src">https://github.com/rust-lang/wg-async-foundations/tree/master/src</a></p>



<a name="210768354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210768354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210768354">(Sep 21 2020 at 16:49)</a>:</h4>
<p>I was thinking we might want to start by creating an error handling book that is stored in our project group repo and use that to develop things like a glossary of terms and chapters on discussion topics such as "API Stability". We can probably build a lot off of the "Failure Book".</p>



<a name="210778672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210778672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210778672">(Sep 21 2020 at 18:08)</a>:</h4>
<p>An error handling book would be incredible!</p>



<a name="210779079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210779079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210779079">(Sep 21 2020 at 18:11)</a>:</h4>
<p>Which is the Failure Book?</p>



<a name="210779192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210779192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210779192">(Sep 21 2020 at 18:12)</a>:</h4>
<p><a href="https://boats.gitlab.io/failure/">https://boats.gitlab.io/failure/</a></p>



<a name="210779222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210779222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210779222">(Sep 21 2020 at 18:12)</a>:</h4>
<p>that's the one</p>



<a name="210779896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210779896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210779896">(Sep 21 2020 at 18:17)</a>:</h4>
<p>another section that I think would be useful would be some api guidelines, specifically so we can explain how to write "idiomatic error messages", tho im not sure that will be something that we can actually define</p>



<a name="210779906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210779906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210779906">(Sep 21 2020 at 18:17)</a>:</h4>
<p>but its worth looking into i think</p>



<a name="210779974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210779974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210779974">(Sep 21 2020 at 18:18)</a>:</h4>
<p>i have my own conventions that I follow that I've tried to base on the conventions in std, I'd be very interested to hear everyone else's conventions</p>



<a name="210791957"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210791957" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210791957">(Sep 21 2020 at 20:01)</a>:</h4>
<p>(renamed this as "The Book of Error" <span aria-label="stuck out tongue" class="emoji emoji-1f61b" role="img" title="stuck out tongue">:stuck_out_tongue:</span> )</p>



<a name="210792032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792032">(Sep 21 2020 at 20:01)</a>:</h4>
<p>i like the idea of the book, I often come across people asking "how to handle errors" and related questions, and it would be nice to point them towards a official resource</p>



<a name="210792109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792109">(Sep 21 2020 at 20:02)</a>:</h4>
<p>agreed</p>



<a name="210792207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792207">(Sep 21 2020 at 20:03)</a>:</h4>
<p>it doesn't have to be about "idiomatic error messages", it can be a checklist of "have you thought about this?"</p>



<a name="210792257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792257">(Sep 21 2020 at 20:03)</a>:</h4>
<p>I'd like it to have a chapter that is just titled "There's no One True Way".</p>



<a name="210792260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792260">(Sep 21 2020 at 20:03)</a>:</h4>
<p>_wondering how the Rust API Guidelines word this_</p>



<a name="210792340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792340">(Sep 21 2020 at 20:04)</a>:</h4>
<p>they call it guidelines</p>



<a name="210792346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792346">(Sep 21 2020 at 20:04)</a>:</h4>
<p>and they have a checklist</p>



<a name="210792378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792378">(Sep 21 2020 at 20:04)</a>:</h4>
<p>whatever we do we should follow the example set here <a href="https://rust-lang.github.io/api-guidelines">https://rust-lang.github.io/api-guidelines</a> for any guidelines we come up with</p>



<a name="210792455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792455">(Sep 21 2020 at 20:05)</a>:</h4>
<blockquote>
<p>Error types are meaningful and well-behaved (C-GOOD-ERR)</p>
</blockquote>



<a name="210792600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792600">(Sep 21 2020 at 20:06)</a>:</h4>
<div class="message_inline_image"><a href="https://upload.wikimedia.org/wikipedia/en/4/44/I_am_Error.png"><img src="https://upload.wikimedia.org/wikipedia/en/4/44/I_am_Error.png"></a></div>



<a name="210792712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792712">(Sep 21 2020 at 20:07)</a>:</h4>
<p>My feels are that there should be "here's ways of doing things. Here's pros/cons. If you still don't know what you want, start with this"</p>



<a name="210792796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792796">(Sep 21 2020 at 20:08)</a>:</h4>
<p>but i understand that people prefer to not be forced to think or design and just want The Answer.</p>



<a name="210792948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210792948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210792948">(Sep 21 2020 at 20:10)</a>:</h4>
<p>(I've heard that phrased as a downside to Rust in general: "I don't like Rust because it makes you think about what you are trying to do before you do it").</p>



<a name="210794512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210794512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210794512">(Sep 21 2020 at 20:20)</a>:</h4>
<p>It's entirely conceivable that error handling could be (or is already) good enough<br>
in Rust to convert generally negative views like that into overall positive<br>
sentiment.</p>



<a name="210794545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210794545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210794545">(Sep 21 2020 at 20:21)</a>:</h4>
<p>My experience begs to differ</p>



<a name="210794604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210794604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210794604">(Sep 21 2020 at 20:21)</a>:</h4>
<p>my personal feeling is that there's only so much we can do, and there will always be a subset of the rust community who is vocal about disliking how "complicated" error handling is in rust</p>



<a name="210794824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210794824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210794824">(Sep 21 2020 at 20:23)</a>:</h4>
<p>Amusingly, I also heard some of the opposite:</p>
<blockquote>
<p>It's just I completely fail to understand what the fuss is all about when it comes to error handling. I don't understand the existence of the myriad error handling libraries, nor the vast amount of improvement ideas, which are in my book introduce zero improvements to the language.<br>
I think Rust has an incredibly nice, convenient, consistent, and simple (!) way of dealing with errors, without magic and whatnot. It just works and it does an amazing job -- by far the best I've seen in the dozen or so languages I speak. I'm not against improvements in general, for example I like the idea of the try-blocks as it was discussed earlier this year. But to create a work-group around this and invest precious time into a non-existent problem.. I fail to see how that's useful.</p>
</blockquote>



<a name="210794966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210794966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210794966">(Sep 21 2020 at 20:24)</a>:</h4>
<p><span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span></p>



<a name="210795030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210795030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210795030">(Sep 21 2020 at 20:25)</a>:</h4>
<p>seems like the difference between "I know how I like to handle errors and I have no interest in learning more about it" and "I dont know how to handle errors and I have no interest in learning more about it"</p>



<a name="210795260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210795260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210795260">(Sep 21 2020 at 20:26)</a>:</h4>
<p>alternatively you could view it as a split between "rust error handling is overcomplicated" and "3rd party error handling libraries are overcomplicated"</p>



<a name="210795891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210795891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210795891">(Sep 21 2020 at 20:32)</a>:</h4>
<p>Which languages are considered to have a comparable error system?</p>



<a name="210796006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210796006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210796006">(Sep 21 2020 at 20:32)</a>:</h4>
<p>Off the top of my head I can't think of a decent competitor</p>



<a name="210796234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210796234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210796234">(Sep 21 2020 at 20:34)</a>:</h4>
<p>the problem is everyone wants a different way of error handling and wants that way to be the way <span aria-label="stuck out tongue" class="emoji emoji-1f61b" role="img" title="stuck out tongue">:stuck_out_tongue:</span></p>



<a name="210796490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210796490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210796490">(Sep 21 2020 at 20:36)</a>:</h4>
<p>Lots of people just want the textual simplicity of Python when writing Rust, and the answer to them is basically always going to be "no, you don't get that." and then a pause, and adding, "but maybe we can get closer."</p>



<a name="210797667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210797667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210797667">(Sep 21 2020 at 20:46)</a>:</h4>
<p>cf. the recent proposal for a short-hand prompt API (good! the current machinery is kinda bulky!) which went all the way up to suggesting, explicitly, "it should be one line because the Python API is one line."</p>



<a name="210798767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210798767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210798767">(Sep 21 2020 at 20:56)</a>:</h4>
<p>One-liners can turn pretty evil honestly</p>



<a name="210805350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210805350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210805350">(Sep 21 2020 at 21:55)</a>:</h4>
<p>Even what you want <em>to do</em> on an error matters. If you want to handle some error cases, you generally need an error enum because that's how rust handles variant situations. If you don't want to handle errors and you just want to say there was an error then <code>Box&lt;dyn ErrorTrait&gt;</code> is all you really need... unless you're no_alloc in which case it's back to the error enum (or even just integer codes, gross) for you.</p>



<a name="210836267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210836267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Seán Kelleher <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210836267">(Sep 22 2020 at 07:36)</a>:</h4>
<p>I think a lot of people just don't want to deal with errors at all, e.g. just want to throw unchecked exceptions and forget about them, and handle them in a single try block at the top level. A lot of error "handling" seems to boil down to just logging that a problem occurred. I think for a lot of people, error handling just isn't the "fun" part of programming, and so they don't want to spend more time on it. That's just my opinion, anyway.</p>



<a name="210836826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210836826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Seán Kelleher <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210836826">(Sep 22 2020 at 07:44)</a>:</h4>
<p>I agree with Jake, that the book should probably describe the different "main" ways of error handling, so that at the very least there's some convention when people decide how they perform error handling, even if they do it in a custom way. Just as a suggestion, I think it should start by laying out a basic/fairly hands-off approach, because realistically, this is going to be the go-to for those people who want quick answers, I'm guessing. This will probably boil down to using <code>?</code> to throw errors that come from an <code>Error</code> enum with all of your variants, define reporters on the variants, and when you run into a problem where you need more context, this is how you add that context. This should be enough to help such people get off the ground and forget about errors. Then there could be one or two more chapters that detail extra "layers" of error handling, depending on how rigorous you want it. These could do things like introduce SNAFU, recommend adding all relevant context for each error, overview of Backtrace etc.</p>



<a name="210836955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210836955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Seán Kelleher <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210836955">(Sep 22 2020 at 07:46)</a>:</h4>
<p>Another suggestion is that it should hopefully be referenced, or perhaps integrated somewhat, in the Rust book; I tend to go to that as a de-facto guide on conventions, etc., and I wonder if others do too.</p>



<a name="210969349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210969349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> imbolc <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210969349">(Sep 23 2020 at 07:54)</a>:</h4>
<p>I'd like the book to have a few entry points, e.g. "coming from c-like langs", "from exception-based langs", "rust as a new lang". And also a chapter on gradual error development, so it would describe how to lay an extendable foundation for error handling with minimal initial effort.</p>



<a name="210986077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257204-project-error-handling/topic/The%20Book%20of%20Error/near/210986077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mukund Lakshman <a href="https://rust-lang.github.io/zulip_archive/stream/257204-project-error-handling/topic/The.20Book.20of.20Error.html#210986077">(Sep 23 2020 at 10:54)</a>:</h4>
<p>"The Book of Error" sounds great. I already want to read it.</p>
<p>I think it should address error production vs. consumption/libraries vs. binaries/error defining (?) vs. reporting. Personally, this distinction was the "a-ha!" moment after which the Rust error handling ecosystem started to make sense.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>